package com.tjtt.tdm.knowledge.service;

import java.io.IOException;
import java.util.List;
import java.util.Map;

import com.tjtt.tdm.base.PageResult;
import com.tjtt.tdm.exception.ServiceException;
import com.tjtt.tdm.knowledge.bean.KnowFileType;
import com.tjtt.tdm.knowledge.bean.KnowledgeHandOut;
import com.tjtt.tdm.knowledge.bean.KnowledgeManage;
import com.tjtt.tdm.knowledge.bean.KnowledgeType;


/**
 * 知识中心
 * @author songxiaoyan
 *
 */
public interface IKnowledgeService {
	
	/**
	 * 查询所有的分类节点
	 * @return KnowledgeType
	 * @throws ServiceException
	 */
	public List<KnowledgeType> getAllTypes(Map filterMap) throws ServiceException;
	
	/**
	 * 根据分类名称查询记录
	 * @param KnowledgeTypeName
	 * @return
	 * @throws ServiceException
	 */
	public List<KnowledgeType> findByProperty(String KnowledgeTypeName) throws ServiceException;
	/**
	 * 文件类别树型结构添加类别
	 * @param knowledgeType void
	 * @author 张海娜
	 * @date 2012-10-15 下午02:08:04
	 */
	public void saveKnowledgeType(KnowledgeType knowledgeType) throws ServiceException;
	
	/**
	 * 更新知识分类
	 * @param knowledgeType
	 * @throws ServiceException
	 */
	public void updateKnowledgeType(KnowledgeType knowledgeType) throws ServiceException;
	
	/**
	 * 删除知识分类
	 * @param knowledgeTypeId
	 * @throws ServiceException
	 */
	public void delKnowledgeType(Long knowledgeTypeId) throws ServiceException;
	
	/**
	 * 根据标签名称判断是否重复
	 * @param KnowFileName
	 * @return
	 * @throws ServiceException
	 */
	public List<KnowFileType> findByFileName(String KnowFileName) throws ServiceException;
	
	/**
	 * 添加标签功能
	 * @param knowFileType
	 * @throws ServiceException
	 */
	public Long saveKnowFileType(KnowFileType knowFileType) throws ServiceException;
	/**
	 * 根据标签名称模糊查询获得符合条件的标签对象集合
	 * @param KnowFileName
	 * @return
	 * @throws ServiceException
	 */
	public List<KnowFileType> getKnowFileType(String KnowFileName,Long start,Long limit) throws ServiceException;
	
	/**
	 * 获得所有的文档信息列表，查询knowledgeManage所有对象集合
	 * @return
	 * @throws ServiceException
	 */
	public PageResult queryKnowledgeManageAfterList(String fileType,Map filterMap) throws ServiceException;
	/**
	 * 获得所有的文档信息列表，查询knowledgeManage所有对象集合
	 * @return
	 * @throws ServiceException
	 */
	public PageResult queryKnowledgeManageList(Map filterMap) throws ServiceException;
	/**
	 * 根据参数得到文件对象集合
	 * @param params
	 * @return
	 * @throws ServiceException
	 */
	public List<KnowledgeManage> findByProperty(Map params) throws ServiceException;
	
	/**
	 * 保存文件功能
	 * @param knowFileType
	 * @throws ServiceException
	 */
	public void saveKnowledgeManage(KnowledgeManage knowledgemanage) throws ServiceException;
	/**
	 * 删除文件功能
	 * @param knowledgeTypeId
	 * @throws ServiceException
	 */
	public void delKnowledgeManage(Long knowledgeTypeId) throws ServiceException;
	/**
	 * 根据角色查询用户
	 * @param filterMap
	 * @return
	 * @throws ServiceException
	 */
	public PageResult queryUsersByRoleId(Map filterMap) throws ServiceException;
	/**
	 * 
	 * @throws Exception void
	 * @author 张海娜
	 * @date 2012-10-11 下午04:04:40
	 */
	public KnowFileType findKnowledgeByName(String typeName) throws ServiceException;
	/**
	 * 功能描述：通过父节点id查询文件列表
	 * @param fileType
	 * @param filterMap
	 * @return
	 * @throws ServiceException PageResult
	 * @author 张海娜
	 * @date 2012-10-15 上午10:52:06
	 */
	public PageResult queryKnowledgeManageListByPatentId(String fileType,Map<String, String> filterMap) throws ServiceException;
	/**
	 * 判断文件类别下是否有文件
	 * @throws IOException
	 * @throws ServiceException void
	 * @author 张海娜
	 * @date 2012-10-19 下午06:30:38
	 */
	public PageResult getCountKnowledgeTypeByFileType(Long id,Map<String, String> filterMap) throws ServiceException ;
	/**
	 * 查询所有的标签
	 * @param filterMap
	 * @return PageResult
	 * @author 张海娜
	 * @date 2012-10-26 下午02:31:39
	 */
	public PageResult getAllKnowFileType(Map<String, String> filterMap);
	
	public Long savaKnowNew(KnowFileType knowFileType)throws ServiceException ;

	public List<KnowFileType> getFileTypeName(String fileName, Long id) throws ServiceException ;

	public KnowFileType findknowFileType(Long biaoqianid);

	public void saveKnowledgeHandOut(KnowledgeHandOut knowledgeHandOut)throws ServiceException;

	public PageResult getAllKnowledgeManageShouCangExec(
			Map<String, String> filterMap);

	public KnowledgeManage findFileAddressById(long id);

	public PageResult getAllKnowledgeManageAfterByUserIdExec(
			Map<String, String> filterMap);

	public PageResult getAllKnowledgeManageByPatentIdByUserIdExec(
			String fileType, Map<String, String> filterMap);

	public String findFenFa(String uid, String id);

	public PageResult searchFenFaUserExec(Map<String, String> filterMap);

	public List<KnowledgeHandOut> findUserids(String knowledgeid);

	public List<KnowledgeHandOut> findKnowledgeHanderOut(long parseLong);

	public void delknowledgeHandOut(long id);

}
